"""web URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url

from . views import IndexViews,UserViews,TypesViews,GoodsViews,orderviews




urlpatterns = [
    
    # 后台首页
    url(r'^$', IndexViews.index,name='myadmin_index'),
    # 登录页面
    url(r'^login/$', IndexViews.adminlogin,name='myadmin_login'),
    # 退出登录
    url(r'^logout/$', IndexViews.adminlogout,name='myadmin_logout'),
    # 验证码请求的路由
    url(r'^vcode/$', IndexViews.verifycode,name='myadmin_vcode'),
    # 管理员列表路由
    url(r'^auth/user/$', IndexViews.authuser,name='myadmin_authuser'),
    # 管理员添加
    url(r'^authuser/add/$', IndexViews.authuseradd,name='myadmin_authuseradd'),
    # 授权组列表路由
    url(r'^auth/group/$', IndexViews.authgroup,name='myadmin_authgroup'),
    url(r'^authgroup/add/$', IndexViews.authgroupadd,name='myadmin_authgroupadd'),
    url(r'^authgroup/edit/(?P<gid>[0-9]+)/$', IndexViews.authgroupedit,name='myadmin_authgroup_edit'),


    # 会员管理
    url(r'^user/index/$', UserViews.index,name='myadmin_user_index'),

    url(r'^user/add/$', UserViews.add,name='myadmin_user_add'),
    
    url(r'^user/insert/$', UserViews.insert,name='myadmin_user_insert'),

    url(r'^user/delete/$', UserViews.delete,name='myadmin_user_delete'),

    url(r'^user/edit/(?P<uid>[0-9]+)/$', UserViews.edit,name='myadmin_user_edit'),

    url(r'^user/update/$', UserViews.update,name='myadmin_user_update'),

    # 分类管理
    url(r'^types/index/$', TypesViews.index,name='myadmin_types_index'),

    url(r'^types/add/$', TypesViews.add,name='myadmin_types_add'),

    url(r'^types/insert/$', TypesViews.insert,name='myadmin_types_insert'),

    url(r'^types/delete/$', TypesViews.delete,name='myadmin_types_delete'),

    url(r'^types/edit/(?P<tid>[0-9]+)/$', TypesViews.edit,name='myadmin_types_edit'),

    url(r'^types/update/$', TypesViews.update,name='myadmin_types_update'),


    # 商品管理
    url(r'^goods/index/$', GoodsViews.index,name='myadmin_goods_index'),

    url(r'^goods/add/$', GoodsViews.add,name='myadmin_goods_add'),

    url(r'^goods/insert/$', GoodsViews.insert,name='myadmin_goods_insert'),

    url(r'^goods/delete/$', GoodsViews.delete,name='myadmin_goods_delete'),

    url(r'^goods/edit/(?P<gid>[0-9]+)/$', GoodsViews.edit,name='myadmin_goods_edit'),

    url(r'^goods/update/$', GoodsViews.update,name='myadmin_goods_update'),

    # 后台首页
    url(r'^$', IndexViews.index,name='myadmin_index'),
    # 登录页面
    url(r'^login/$', IndexViews.adminlogin,name='myadmin_login'),
    # 退出登录
    url(r'^logout/$', IndexViews.adminlogout,name='myadmin_logout'),
    # 验证码请求的路由
    url(r'^vcode/$', IndexViews.verifycode,name='myadmin_vcode'),
    # 订单
    url(r'^order/list/$', orderviews.orderlist,name='myadmin_order_list'),
    #订单编辑
    url(r'^order/edit/(?P<oid>[0-9]+)/$', orderviews.orderedit,name='myadmin_order_edit'),

]
